//
//  AppDelegate.m
//  <18> 绘制带属性的字体
//
//  Created by chen on 16/9/19.
//  Copyright © 2016年 tyrad. All rights reserved.
//

#import "AppDelegate.h"

@interface AppDelegate ()

@property (weak) IBOutlet NSWindow *window;
@end

@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    
    //"若size为0,方法将返回默认字体大小"
    [NSFont userFontOfSize:0.0]; //返回用户默认的字体
    [NSFont userFixedPitchFontOfSize:12.0];
    [NSFont messageFontOfSize:12];
    [NSFont toolTipsFontOfSize:12];
    [NSFont titleBarFontOfSize:12];
    [NSFont fontWithName:@"Times-Roman" size:12.0]; //自定的字体
 
    
    //属性字符串
    NSMutableAttributedString *string  ;
    
    string = [[NSMutableAttributedString alloc]initWithString:@"Big Times Roman"];
    [string addAttribute:NSFontAttributeName value:[NSFont userFontOfSize:22] range:NSMakeRange(0, 8)];
    [string addAttribute:NSUnderlineStyleAttributeName value:@(1) range:NSMakeRange(0, 3)];
    
    
    
    
}


- (void)applicationWillTerminate:(NSNotification *)aNotification {

}


@end
